package com.lagou.common.utils;

import com.lagou.common.pojo.Result;

/**
 * @author tengfei wang
 * @version 1.0
 * @date Created in 2020/9/17
 */
public class ResultUtils {

    public static Result success() {
        Result result = new Result();
        result.setCode(0);
        result.setMessage("success");
        return result;
    }

    public static Result success(Object o) {
        Result result = new Result();
        result.setCode(0);
        result.setResult(o);
        result.setMessage("success");
        return result;
    }

    public static Result error(Integer code, String message) {
        Result result = new Result();
        result.setCode(code);
        result.setMessage(message);
        return result;
    }
}
